<template>
  <div>
      <button @click='increment'>加加加加</button>
      <h3>{{$store.state.count}}</h3>
  </div>
</template>

<script>
export default {
name:'Count',
data() {
    return {
        num:1
    }
},
methods:{
    increment(){
        // console.log(this.$store.state);调用actions
        this.$store.dispatch('add',this.num)
    }
},

}
</script>

<style>

</style>